import User.Adminduse;
import User.Generaluser;
import User.Users;
import book.BookList;

import java.util.Scanner;

/**
 * Created by Salted fish
 * Description:
 * User: 24539
 * Date：2021-09-22
 * Time: 16:41
 */
public class Test {

    public static Users login() {
        System.out.println("请输入姓名： ");
        Scanner scanner = new Scanner(System.in);
        String name = scanner.next();
        System.out.println("请确认输入你的身份：1. 管理员       2. 普通用户 ");
        int choice = scanner.nextInt();
        if(choice == 1) {
            return new Adminduse(name);
        }else {
            return new Generaluser(name);
        }
    }

    public static void main(String[] args) {
        BookList bookList = new BookList();
        Users users = login();
        while (true) {
            int choice = users.menu();

            users.doOperation(choice, bookList);
        }
    }
}
